﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Web.Services;
using BLL;
using System.Collections;
using Model;

namespace GeniusWebApplication
{
    public partial class redify : System.Web.UI.Page
    {
        public User user = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            user = (User)HttpContext.Current.Session["user"];
            if (user == null)
                Response.Redirect("log.aspx");

        }
        [WebMethod]
        public static string ajaxRedifyUser(string username,string npassword)
        {
            UserService userService = new UserService();
            User user = new User();
            user = userService.getUserByEmail(username);
            Hashtable ht = userService.modifyPassword(user, npassword);
            string result = (string)ht["result"];
            return "{" +
                        "result:'" + result + "'" +
                    "}";
        }
    }
}